#include <cstdint.h>
#ifndef __ATL_VFS__
#define __ATL_VFS__

#define VFS_FILE_FLAG        0x00
#define VFS_DIRECTORY_FLAG   0x01
#define VFS_SYMLINK_FLAG     0x02
#define VFS_CHARDEVICE_FLAG  0x04
#define VFS_BLOCKDEVICE_FLAG 0x05
#define VFS_PIPE_FLAG	     0x06
#define VFS_MOUNTPOINT_FLAG  0x08

typedef uint32_t (*read_fs_t) (struct vfs_node*,uint8_t *,uint32_t,uint32_t,uint32_t);
typedef uint32_t (*write_fs_t) (struct vfs_node*,uint8_t *,uint32_t,uint32_t,uint32_t);
typedef void (*open_fs_t) (struct vfs_node*);
typedef void (*close_fs_t) (struct vfs_node*);
typedef struct vfs_dir * (*readdir_fs_t) (struct vfs_node*, uint32_t);
typedef struct vfs_node * (*finddir_fs_t) (struct vfs_node*,char *);
typedef struct vfs_node * (*touch_fs_t) (struct vfs_node*,char *,uint32_t mode);
typedef struct vfs_node * (*mkdir_fs_t) (struct vfs_node*,char *,uint32_t mode);

typedef struct vfs_node {
	char name[128];
	uint32_t uid;
	uint32_t gid;
	uint32_t mask;
	uint32_t flags;
	uint32_t impl;
	uint32_t inode;
	uint32_t length;
	open_fs_t open;
	close_fs_t close;
	read_fs_t read;
	write_fs_t write;
	readdir_fs_t readdir;
	finddir_fs_t finddir;
	touch_fs_t touch;
	mkdir_fs_t mkdir;
	struct vfs_node *ptr;
	struct vfs_node *parent;
} vfs_node_t;

typedef struct vfs_dir {
	char name[128];
	uint32_t inode;
} vfs_dir_t;
#endif